﻿$(function () {
    //$("#agreeInfo").height($("#agreeInfo article").height());
    $("#agreeInfo-link").click(function () {
        funshowDialog("#agreeInfo");
        //$('.scroller').css({'-webkit-transform': 'translate(0px,0)'});
    });
})
//var currentDialog = "";
//function funshowDialog(currentDialogName) {
//  if (currentDialog == currentDialogName) {
//    $(currentDialog).css('display','none');
//    currentDialog = "";
//    return;
//  };
//  if (currentDialog === "") {
//      $(currentDialogName).css('display', 'block');
//  } else {
//    $(currentDialog).hide();
//    $(currentDialogName).css('display', 'block');
//  };
//  currentDialog = currentDialogName;
//};


var currentDialog = null;
function funshowDialog(currentDialogName) {
    if (!currentDialogName) return false;

    if (currentDialog == null) {
        currentDialog = currentDialogName;
        $(currentDialogName).css('display', 'block');
    } else {
        if ($(currentDialogName).css("display") == "block") {
            $(currentDialogName).css('display', 'none');
            currentDialog = null;
        } else {
            $(currentDialogName).css('display', 'block');
            currentDialog = currentDialogName;
        }
    }
}
window.addEventListener("hashchange", backClose, false);
function backClose() {
    if (currentDialog != null) {
        $(currentDialog).css('display', 'none');
        currentDialog = null;
    }
}